package com.wondream.dao;

import com.wondream.domain.Article;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

/**
 * @author wondream
 * @version 1.0
 * @create 2022/5/12 6:08 AM
 */
public interface ArticleNativeSqlDao extends JpaRepository<Article, Integer>, JpaSpecificationExecutor<Article> {

    // 本地SQL查询
    @Query(value = "select * from Article a where a.title=?1 and a.author=?2", nativeQuery = true)
    List<Article> findByTitleAndAuthor(String title, String author);
}
